const { ccclass, property } = cc._decorator;
import RefreshNodeControl from './RefreshNodeControl';
import StatusNodeControl from './StatusNodeControl';

@ccclass
export default class AttackNodeControl extends cc.Component {
    @property(cc.Node)
    HStatus: cc.Node = null;
    @property(cc.Node)
    HRefresh: cc.Node = null;
    @property(cc.Node)
    MStatus: cc.Node = null;
    @property(cc.Node)
    MRefresh: cc.Node = null;
    statusPrefabs: Map<string, cc.Prefab> = new Map();
    refreshPrefabs: Map<string, cc.Prefab> = new Map();

    _hStatus: StatusNodeControl = null;
    _hRefresh: RefreshNodeControl = null;
    _mStatus: StatusNodeControl = null;
    _mRefresh: RefreshNodeControl = null;

    onLoad() {
        this._hStatus = this.HStatus.getComponent(StatusNodeControl);
        this._hRefresh = this.HRefresh.getComponent(RefreshNodeControl);
        this._mStatus = this.MStatus.getComponent(StatusNodeControl);
        this._mRefresh = this.MRefresh.getComponent(RefreshNodeControl);
        this._hStatus.initNodes(this.statusPrefabs);
        this._mStatus.initNodes(this.statusPrefabs);
        this._hRefresh.initNodes(this.refreshPrefabs);
        this._mRefresh.initNodes(this.refreshPrefabs);
    }
}
